package com.huwei.sweetmusicplayer.models;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.huwei.sweetmusicplayer.models.MusicInfo;
import com.huwei.sweetmusicplayer.models.AlbumInfo;

import com.huwei.sweetmusicplayer.models.MusicInfoDao;
import com.huwei.sweetmusicplayer.models.AlbumInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig musicInfoDaoConfig;
    private final DaoConfig albumInfoDaoConfig;

    private final MusicInfoDao musicInfoDao;
    private final AlbumInfoDao albumInfoDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        musicInfoDaoConfig = daoConfigMap.get(MusicInfoDao.class).clone();
        musicInfoDaoConfig.initIdentityScope(type);

        albumInfoDaoConfig = daoConfigMap.get(AlbumInfoDao.class).clone();
        albumInfoDaoConfig.initIdentityScope(type);

        musicInfoDao = new MusicInfoDao(musicInfoDaoConfig, this);
        albumInfoDao = new AlbumInfoDao(albumInfoDaoConfig, this);

        registerDao(MusicInfo.class, musicInfoDao);
        registerDao(AlbumInfo.class, albumInfoDao);
    }
    
    public void clear() {
        musicInfoDaoConfig.getIdentityScope().clear();
        albumInfoDaoConfig.getIdentityScope().clear();
    }

    public MusicInfoDao getMusicInfoDao() {
        return musicInfoDao;
    }

    public AlbumInfoDao getAlbumInfoDao() {
        return albumInfoDao;
    }

}
